From 388d2a75c32196b8b9062413e1d52ce516f025a5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roger=20Pau=20Monn=C3=A9?= Date: Tue, 6 Oct 2015 17:38:41 +0200 Subject: [PATCH] vcpu: add missing dummy_vcpu_info to compat VCPUOP_initialise MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This check is missing from the compat version when compared to the non-compat version. Signed-off-by: Roger Pau Monné --- xen/common/compat/domain.c | 3 +++ xen/common/domain.c | 2 +- xen/include/xen/shared.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/xen/common/compat/domain.c b/xen/common/compat/domain.c index 3ca4ef7329..157570a97e 100644 --- a/xen/common/compat/domain.c +++ b/xen/common/compat/domain.c @@ -38,6 +38,9 @@ int compat_vcpu_op(int cmd, unsigned int vcpuid, XEN_GUEST_HANDLE_PARAM(void) ar { struct compat_vcpu_guest_context *cmp_ctxt; + if ( v->vcpu_info == &dummy_vcpu_info ) + return -EINVAL; + if ( (cmp_ctxt = xmalloc(struct compat_vcpu_guest_context)) == NULL ) { rc = -ENOMEM; diff --git a/xen/common/domain.c b/xen/common/domain.c index 7c362eb3cf..b0378aa98b 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -70,7 +70,7 @@ integer_param("hardware_dom", hardware_domid); struct vcpu *idle_vcpu[NR_CPUS] __read_mostly; -static vcpu_info_t dummy_vcpu_info; +vcpu_info_t dummy_vcpu_info; static void __domain_finalise_shutdown(struct domain *d) { diff --git a/xen/include/xen/shared.h b/xen/include/xen/shared.h index 3f5b2835d5..a411a8a3e3 100644 --- a/xen/include/xen/shared.h +++ b/xen/include/xen/shared.h @@ -41,6 +41,8 @@ typedef struct vcpu_info vcpu_info_t; #endif +extern vcpu_info_t dummy_vcpu_info; + #define shared_info(d, field) __shared_info(d, (d)->shared_info, field) #define vcpu_info(v, field) __vcpu_info(v, (v)->vcpu_info, field) -- 2.30.2